﻿@model IEnumerable<KPIS.GERP.Models.SYS.Message> 
@{ 
    ViewBag.Title = "กล่องข้อความของคุณ";
    ViewBag.Descr = "เป็นข้อความติดต่อทั่วไประหว่างผู้ใช้ในระบบ";
}

@using (Html.BeginForm("DeleteAll", "Message", FormMethod.Post, new {@id="form"}))
{
    @Html.AntiForgeryToken()
    <div class="row-fluid">
        <div class="block-button-menu-above">
            @Html.ButtonDeleteAll()
        </div>
        @Html.ValidationSummary(true, "", new { @class = "alert alert-error" })
        <div class="row-fluid">
            <div class="table-header span12">
				<div class="span10">
					@ViewBag.Title
				</div>
				@Html.Partial("_ExportButton")
            </div>
        </div>

        <table id="table" class="table table-striped table-bordered table-hover" aria-describedby="table_info">
            <thead>
                <tr>
                    <th class="center" style="width:50px;">
						<!-- Check box delete multiple records column-->
                        <label>
                            <input type="checkbox" />
                            <span class="lbl"></span>
                        </label>
                    </th>
					<th>
						@Html.DisplayNameFor(m=>m.MessageId)
                    </th> 
					<th>
						@Html.DisplayNameFor(m=>m.Date)
                    </th> 
					<th>
						@Html.DisplayNameFor(m=>m.FromEmployee.FullName)
                    </th> 
					<th>
						@Html.DisplayNameFor(m=>m.FromEmployee.JobSite.Name)
                    </th>  
					<th>
						@Html.DisplayNameFor(m=>m.Title)
                    </th>  
					<th>
						@Html.DisplayNameFor(m=>m.MessageStatus)
                    </th>  
				</tr>
			</thead>
            <tbody> 
				@foreach(var m in Model??new List<KPIS.GERP.Models.SYS.Message>())
				{ 
					<tr>
						<td class="center">
							<!-- Check box all for delete multiple records -->
							<label>
								<input type="checkbox" name="deleteIds" value="@(m.MessageId)" />
								<span class="lbl"></span>
							</label>
						</td>
						<td>
							@Html.DisplayFor(n => m.MessageId)  
						</td> 
						<td>
							@Html.DisplayFor(n => m.Date  )
						</td> 
						<td>
							@Html.DisplayFor(n => m.FromEmployee.FullName  )
						</td> 
						<td>
							@Html.DisplayFor(n => m.FromEmployee.JobSite.Name  )
						</td> 
						<td>
							@Html.DisplayFor(n => m.Title  )
						</td> 
						<td>
							@Html.DisplayFor(n => m.MessageStatus  )
						</td> 
						<td>
							@Html.ActionLink("ดูข้อมูล", "Details", new {approvalTaskSeq = m.MessageId})
						</td>

					</tr> 
				} 
			</tbody>
		</table> 
    </div>
}
                    

<style>
    .titlemessage {
        margin: 0 0 0 0;
        padding: 0 0 0 0;
        cursor: pointer;
    } 
    .titlemessage:hover {
        cursor: pointer;
        color: white;
        background: rgb(59, 89, 151);
    } 

</style>